#include <iostream>
#include <cmath>
using namespace std;
#define int long long

signed main()
{
    int m,n;
    cin>>m>>n;
    int flag = 0;
    for(int a=m;a<=n;a++){
        double t = sqrt(pow(a,3)-pow(a-1,3));
        int c = round(t);
        if(c==t){
            for(int b=1;b<a;b++){
                if(b*b+(b-1)*(b-1)==c){
                    flag = 1;
                    cout<<a<<" "<<b<<"\n";
                }
            }
        }
    }
    if(!flag)    cout<<"No Solution\n";
    return 0;
}
